clear; clc; close all;

% 参数设置
a = 5; b = 1; P = 1; Q = 1;
x0 = 1; y0 = -1;
N_total = 1500;

% q 范围和采样点数
q_list = linspace(0, 2, 400);
M_q = length(q_list);
    

Y_cell = cell(M_q, 1);

parfor idx = 1:M_q
    q = q_list(idx);
    y_vec = SCLMM(q, a, b, P, Q, x0, y0, N_total);
    Y_cell{idx} = y_vec;
end

% 绘图
figure; hold on;
for idx = 1:M_q
    q = q_list(idx);
    y_vec = Y_cell{idx};
    q_vec = q * ones(size(y_vec));
    scatter(q_vec, y_vec, 1, 'b', 'filled');
end
xlabel('q', 'FontSize', 14);
ylabel('y(n)', 'FontSize', 14);
title('2D-SCLMM 分岔图', 'FontSize', 16);
set(gca, 'FontSize', 12);
box on;

